﻿
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ include file="../../common.jsp" %>
<%@ page import="java.util.StringTokenizer"%>
<%@ taglib uri="/page.util.gs.hitrust.com/taglibs/page" prefix="page"%>

<%@page import="system.LoginContext"%>
<%@page import="framework.core.SrvContext"%>
<html>
<head>
<title>产品最高库存设置查询</title>
<META http-equiv=Content-Type content="text/html; charset=UTF-8">
<LINK href="<%=root%>/css/caigouxitong.css" type=text/css rel=stylesheet>
<SCRIPT language="JavaScript" src="<%=root%>/js/common.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/calendar.js"></SCRIPT>
<SCRIPT language="JavaScript" src="<%=root%>/js/string.js"></SCRIPT>

<%
ArrayList deptList = new ArrayList();
ArrayList addrList = new ArrayList();

ArrayList ary = (ArrayList)request.getAttribute("organdaddr");

	ArrayList tManuf1 = (ArrayList)request.getAttribute("manufacture1");
	
	ResultProcess tOrder = (ResultProcess)request.getAttribute("maxStorageList");
	ArrayList tList = new ArrayList();
	String[] tStr = null;
%>

<script>
	var counter;
	var allprovider = new Array();

	<%
		//在此作出成功提示
		if(request.getAttribute("SUCCESSMSG") != null)
			out.print("alert('"+request.getAttribute("SUCCESSMSG")+"');");
	%>
	
	function query(){
		orderrauditform.action = "<%=response.encodeURL(root+"/A3000021.do")%>";
    	orderrauditform.submit();	
	}
  	
	
	
	function exportExcel(){
		orderrauditform.action = "<%=response.encodeURL(root+"/A3000015.do")%>";
    	orderrauditform.submit();
	}

	function cls(){

		document.orderrauditform.m_concentricity_code.value = "";
		document.orderrauditform.m_product_name.value = "";
		document.orderrauditform.m_spec.value = "";
		document.orderrauditform.m_model.value = "";
		document.orderrauditform.m_drawing_piece_code.value = "";
		document.orderrauditform.m_provider_code.value = "";

		document.orderrauditform.m_currentWarehouseCode.options[0].selected=true;
		document.orderrauditform.m_status.options[0].selected=true;
		
	}
</script>
</head>



<body BGCOLOR="#f5f5f5"	text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="<%if("T".equals(request.getAttribute("ISQUERYCONDITIONEXIST"))){out.println("process('Q')");}%>">

<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td height="20"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="1">
        <tr height="20">
          <td height="20" width="1" class="mtxt_black">&nbsp;</td>
          <td height="30" width="758" class="mtxt_black">产品最高库存查询</td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td class="bg_line" height="2"></td>
  </tr>
</table>

<br>


<form name="orderrauditform" method="get" >
<table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
	<tr> 
		<td> 
			<table class=bg_table id=tableId	cellspacing=1 cellpadding=0 style="padding-left:5;padding-right:5" width=100% align=center border=0>
				<TR height=20>
					<TD class="bg_column" align=center>集中编码：</TD>
					<TD align=left class="bg_row_odd" >
					<input type="text" name="m_concentricity_code" maxlength="20" value="<%=request.getParameter("m_concentricity_code")==null?"":request.getParameter("m_concentricity_code")%>">
					</TD>
                    <td class="bg_column" align=center>产品名称：</td>
                    <td align=left class="bg_row_odd" >
                    <input type="text" name="m_product_name" value="<%=request.getParameter("m_product_name")==null?"":request.getParameter("m_product_name") %>">
                    </td>
				</TR>
				
				<TR height=20>
					<TD class="bg_column" align=center>规&nbsp;&nbsp;&nbsp;&nbsp;格：</TD>
					<TD align=left class="bg_row_odd" >
					<input type="text" name="m_spec" maxlength="20" value="<%=request.getParameter("m_spec")==null?"":request.getParameter("m_spec") %>">
					</TD>
                    <td class="bg_column" align=center>型&nbsp;&nbsp;&nbsp;&nbsp;号：</td>
                    <td align=left class="bg_row_odd" >
                    <input type="text" name="m_model" value="<%=request.getParameter("m_model")==null?"":request.getParameter("m_model") %>">
                    </td>
				</TR>
				
				<TR height=20>
					<TD class="bg_column" align=center>图&nbsp;件&nbsp;号：</TD>
					<TD align=left class="bg_row_odd" >
					 <input type="text" name="m_drawing_piece_code" value="<%=request.getParameter("m_drawing_piece_code")==null?"":request.getParameter("m_drawing_piece_code") %>">
					</TD>
                    <td class="bg_column" align=center>供&nbsp;应&nbsp;商：</td>
                    <td align=left class="bg_row_odd" >
                    <input type="text" name="m_provider_code" value="<%=request.getParameter("m_provider_code")==null?"":request.getParameter("m_provider_code") %>">
                    </td>
				</TR>
				
				<TR height=20>				
					<TD class="bg_column" align=center>所属分公司：</TD>
					<TD align=left class="bg_row_odd">
				        <select id='orderDept' name='m_currentWarehouseCode'>
                            <%String warehouseCode = request.getParameter("m_currentWarehouseCode")==null?"":request.getParameter("m_currentWarehouseCode"); %>
							<option value="<%=LoginContext.get(new SrvContext(request,response)).getLoginWarehouseCode() %>">---全部---</option><%
                              if(ary!=null&&ary.size()>0){
                                 for(int i=0;i<ary.size();i++){ 
                                     GSWareHouseBean tmp=(GSWareHouseBean)ary.get(i);%>
                                    <%if(tmp.getCode().equals(warehouseCode)){ %>
                                        <option value="<%=tmp.getCode() %>" selected><%=tmp.getName() %></option>
                                    <%}else{ %>
                                    <option value="<%=tmp.getCode() %>"><%=tmp.getName() %></option>
                            <%}}} %>         
                    	</select>
					</TD>
					
					<TD class="bg_column" align=center>状&nbsp;&nbsp;&nbsp;&nbsp;态：</TD>
					<TD align=left class="bg_row_odd">
					 <select name="m_status">
		            	<option value="" <%=request.getParameter("m_status")==null?"selected":""%>>全部</option>
		            	<option value="1" <%="1".equals(request.getParameter("m_status"))?"selected":""%>>启用</option>
		            	<option value="0" <%="0".equals(request.getParameter("m_status"))?"selected":""%>>不启用</option>
		            </select>
					</TD>
                     	
				</TR>
													
													
			</table>
		</td>
	</tr>
    <tr>
            <%
            if(tOrder != null) {
                int totalRecords = 0;
                if(request.getAttribute("totalRecords")!=null){
                    totalRecords=Integer.parseInt((String)request.getAttribute("totalRecords"));
                }
                int defaultPageSize =10;
                if(request.getAttribute("pageSize")!=null){
                    defaultPageSize=Integer.parseInt((String)request.getAttribute("pageSize"));
                }
            %>          
            <page:pager total='<%=totalRecords%>' defaultPageSize='<%=defaultPageSize%>'></page:pager>
            <%} %>
    </tr>
</table>
</form>
    <p align="center">  
		<input type="button" class="kuang" value="查询" width="58" height="24" onclick="query()"/>&nbsp;
		<input type="button" class="kuang" value="清空" width="58" height="24" onclick="cls()"/>&nbsp;
    </p>
<%

	if(tOrder != null){
%>
	<center>
    <table width="98%" border="0" cellspacing="0" cellpadding="0" align="center">
		<tr>
			<td>
            <form name='pager' method="post">
			<input type="hidden" name='confirmorreject'>
            <input type='hidden' name='auditcontent' >
            	<table class=bg_table id=tableId	cellspacing=1 cellpadding=2 width=100% align=center border=0>
                    <tbody> 
                    <tr class="bg_column" height=20> 
                    	
                        <td class=top align=center > 
                        <div align="center" class="txt_content">集中编码</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">产品名称</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">单位</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">单价</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">规格</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">型号</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">图件号</div>
                        </td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">供应商</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">最高库存</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">所属仓库</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">最后更新时间</div>
						</td>
                        <td class=top align=center > 
                        <div align="center" class="txt_content">状态</div>
						</td>                  
					</tr>
					<%
						tList = tOrder.getAllRecoreds();

						if(tList != null && tList.size() > 0){
						for(int i=0; i<tList.size(); i++){
							ProductTiptopStockVO tipTopVo = (ProductTiptopStockVO)tList.get(i);
							String tTempStr="";
							if(i%2==0){
								tTempStr="class=\"bg_row_odd\"";
							}else {
								tTempStr="class=\"bg_row_even\"";
							}

							//初始化供应商
					%> 
					
							<tr <%=tTempStr%> height=20>
										
								<!--集中编码-->
								<td class=top align=center  > 								
									<div align="center" class="txt_content">
										<%=tipTopVo.getConcentricity_code()%>
									</div>
								</td>	
								<!--产品名称-->							
								<td class=top align=center > 
									<div align="center" class="txt_content">
									<%=tipTopVo.getName()%>
									</div>
								</td>
								<!--单位-->
								<td class=top align=center > 
									<div align="center" class="txt_content">
									<%=tipTopVo.getProduct_unit()%>
									</div>
								</td>	
								<!--单价-->			
								<td class=top align=center > 
									<div align="center" class="txt_content">
									<%=tipTopVo.getUnit_price()%>
									</div>
								</td>	
								<!--规格-->			
								<td class=top align=center > 
									<div align="center" class="txt_content">
									<%=tipTopVo.getSpec()%>
									</div>
								</td>	
								<!--型号-->			
								<td class=top align=center > 
									<div align="center" class="txt_content">
									<%=tipTopVo.getModel()%>
									</div>
								</td>
                                <!--图件号-->           
                                <td class=top align=center > 
                                    <div align="center" class="txt_content">
                                   <%=tipTopVo.getDrawing_piece_code()%>
                                    </div>
                                </td>   	
								<!--供应商-->			
								<td class=top align=center > 
									<div align="center" class="txt_content">
									<%=tipTopVo.getProvidername()%>
									</div>
								</td>	
								<!--最高库存-->			
								<td class=top align=center > 							
									<div align="center" class="txt_content" id="">
									<%=tipTopVo.getMax_count()%>
									</div>
                                    
								</td>	
																																							
								<!--所属仓库-->			
								<td class=top align=center  > 
									<div align="center" class="txt_content" >
									<%=tipTopVo.getWarehouse_code()%>
									</div>
								</td>	
								<!--最后更新时间-->

								<td class=top align=center> 
									<div align="center" class="txt_content"  >
									<%=tipTopVo.getLast_update_time()%>
									</div>
								</td>
								<!--状态-->			
								<td class=top align=center  id='totalprice'> 
									<div align="center" class="txt_content" >
									<%=tipTopVo.getStatus()%>
									</div>
								</td>
								
							</tr> 
						
							
					<%	
						}
					%>
						  <tr class="bg_column" height=20>
						    <td width="960" height="16" colspan="18" align="right">
									<!--导航条-->
						    		<page:navigator type='text' queryForm='orderrauditform'/>
						    </td>
						  </tr>
				    <%
						}else{
					%>
                            <tr class="bg_column" height=20>
                            <td width="960" height="16" colspan="19" align="center"
                               ><font color="red">没有符合条件的产品最高库存设置信息,请重新输入查询条件</font></td>
                            </tr>
					<%
						}
					%>
					</tbody>
				</table>
				</form>					  
			</td>
		</tr>
	</table>
	</center>
	<p align="center">  
    
		<input type=button value="导出excel" class="buttons" onclick="exportExcel();return false;">
       
    </p>
	
<%		
	}
	if(tOrder == null && request.getAttribute("ISQUERYCONDITIONEXIST") != null && request.getAttribute("ISQUERYCONDITIONEXIST").equals("T")){
%>
		<font size="2">数据查询中......</font>
<%
	}
%>

</body>
</html>